package com.zh.webflux.log;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author ZH
 * @date 16:07 2021/11/5
 */
@Getter
@Setter
//@Document("log_operate") //Mongodb注解
public class OperateLogRecord implements Serializable {
//    @Id
    private String id;

    private String accessUri;

    private String operation;
    /**
     * 操作用户
     */
    private String username;

    private String remoteHost;

    private String queryParams;

    private LocalDateTime createTime;

    private OperateLogRecord(){

    }

    public OperateLogRecord(String remoteHost, String operation, String accessUri) {
        this(remoteHost,operation,accessUri,"{}");
    }

    public OperateLogRecord(String remoteHost, String operation, String accessUri, String queryParams) {
        this.remoteHost = remoteHost;
        this.operation = operation;
        this.accessUri = accessUri;
        this.queryParams = queryParams;
    }
}
